/** 用户查询的区域树 */
var setting = {
	async : {
		enable : true,
		url : ctp + "/orgController/orgTree.shtml",
		autoParam : [ "code=orgCode" ]
	},
	data : {
		simpleData : {
			enable : true
		}
	},
	callback : {
		onClick : zTreeOnClick,
		onAsyncSuccess : onAsyncSuccess
	}
};

function zTreeOnClick(event, treeId, treeNode, clickFlag) {
	$("#orgName").val(treeNode.name);
	$("#orgCode").val(treeNode.code);
	setTagAndValue("form1", "orgCode", treeNode.code);
	searchData();
}
function onAsyncSuccess(event, treeId, treeNode, clickFlag) {
	var treeObj = $.fn.zTree.getZTreeObj("ztree");
	var treenode = treeObj.getNodeByParam("code", 1, null);
	treeObj.expandNode(treenode, true, false, true);
}
$(function() {
	$.fn.zTree.init($("#ztree"), setting);
});

function inistalldepttree() {
	$.fn.zTree.init($("#ztree"), setting);
}